package org.sadko.boozemeter;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;


public class BoozeMeter extends Activity {

public static final int MESSAGE_EXIT = 2;	
public static MyHandler mHndl;
	
	
	private class MyHandler extends Handler{
		@Override
		public void handleMessage(Message msg){
			switch(msg.what){
				case MESSAGE_EXIT:{
				finish();
			}
			}
		}
	}
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        mHndl = new MyHandler();
        
        Button button = (Button) this.findViewById(R.id.start_button);
        button.setOnClickListener(new OnClickListener() {
        	public void onClick(View v){
        		Intent intent = new Intent(BoozeMeter.this, TremorSensor.class);
        		BoozeMeter.this.startActivity(intent);

        	}
        });
        
        button = (Button) this.findViewById(R.id.about_button);
        button.setOnClickListener(new OnClickListener() {
        	public void onClick(View v){
        		Intent intent = new Intent(BoozeMeter.this, AboutActivity.class);
        		BoozeMeter.this.startActivity(intent);

        	}
        });
    }

}